//1.引入模块
import Vue from "vue";//引入vue模块

import App from "./components/APP.vue";//引入vue实例化组件模块
import login from "./components/account/login.vue"
import register from "./components/account/register.vue"

import Router from "vue-router";//引入路由模块

import Mint from 'mint-ui';//导入mint-ui组件
import 'mint-ui/lib/style.css';
import { Toast } from 'mint-ui';


//2.创建路由对象
var router = new Router({
    routes: [
        { path: "/", redirect: "/login" },
        { path: "/login", component: login },
        { path: "/register", component: register },
    ]
})

//3.将引用的组件对象绑定到vue上
Vue.use(Router);
Vue.use(Mint);


//4.实例化一个vue对象
var vm = new Vue({
    el: "#app",
    render: create => create(App),
    methods:{
        submit(){
            Toast({
                message: '提示信息',
                position: 'middle',
                duration: 2000
              });
        }
    },
    mounted(){
        this.submit()
    },
    router,//挂载路由
})